<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class SystemStoreGroup extends Model
{
    use HasFactory;

    public $timestamps = false;
    protected $guarded = [];
    protected $table = "system_store_group";


    /**
     * 删除
     * @param $id
     * @return int
     */
    public static function groupDelModel($id)
    {
        return self::where('id',$id)->update(['is_del'=>1]);
    }

    /**
     * @param array $data
     * @return mixed
     */
    public static function addGroup(array $data)
    {

        return self::create($data);
    }

    /**
     * 分组
     * @return mixed
     */
    public static function groupList($where)
    {
        return SystemStoreGroup::where($where)->paginate(10);
    }


    public static function updateModel($id,$data){
        return SystemStoreGroup::where("id",$id)->update($data);
    }
}
